]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
background: Look at the duration per-step
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 14 Mar 2013 20:58:52 +0000 (16:58 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 14 Mar 2013 21:48:07 +0000 (17:48 -0400)
We need to look at the duration of the current step of the slideshow
to determine when to next queue an event, rather than the full slideshow
duration.

https://bugzilla.gnome.org/show_bug.cgi?id=695882

js/ui/background.js

index bfe06a526f5cd29797ebba72ba09e8e879488be4..0672dd14e669a73ece0d272a4a9fae9f1229d628 100644 (file)
@@ -440,11 +440,11 @@ const Background = new Lang.Class({
         if (!this._cancellable || this._cancellable.is_cancelled())
             return;
 
-        if (!this._animation.duration)
+        if (!this._animation.transitionDuration)
             return;
 
         let nSteps = 255 / ANIMATION_OPACITY_STEP_INCREMENT;
-        let timePerStep = (this._animation.duration * 1000) / nSteps;
+        let timePerStep = (this._animation.transitionDuration * 1000) / nSteps;
 
         let interval = Math.max(ANIMATION_MIN_WAKEUP_INTERVAL * 1000,
                                 timePerStep);
@@ -591,8 +591,8 @@ const Animation = new Lang.Class({
 
         this.filename = params.filename;
         this.keyFrameFiles = [];
-        this.duration = 0.0;
         this.transitionProgress = 0.0;
+        this.transitionDuration = 0.0;
         this.loaded = false;
     },
 
@@ -604,7 +604,6 @@ const Animation = new Lang.Class({
         this._show.load_async(null,
                               Lang.bind(this,
                                         function(object, result) {
-                                            this.duration = this._show.get_total_duration();
                                             this.loaded = true;
                                             if (callback)
                                                 callback();
@@ -622,6 +621,7 @@ const Animation = new Lang.Class({
 
         let [progress, duration, isFixed, file1, file2] = this._show.get_current_slide(monitor.width, monitor.height);
 
+        this.transitionDuration = duration;
         this.transitionProgress = progress;
 
         if (file1)